﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Xml.XPath;
using System.Xml;
using project_web2.FactoryAPI;

namespace project_web2.UserInterface {
    public partial class adminToolMenu : System.Web.UI.UserControl {
        XmlDocument xml = new XmlDocument();
        protected void Page_Load(object sender, EventArgs e) {
            if (Session["Login"] == null) {
                return;
            } 
            loadMenuXML();
        }
        private void loadMenuXML() {
            try {
                xml.Load(Server.MapPath("../FactoryAPI/configAminTool.xml"));
            } catch {
                xml = null;
            }
            if (xml != null) {
                DataTable dt = xmlDataAdminToolMenu.loadAdminToolMenu(xml);
                gvAmintoolMenu.DataSource = dt;
                gvAmintoolMenu.DataBind();
            }
        }
    }
}